/**
 * @fileOverview Special Character plugin
 */
VED.plugins.add( 'specialchar', {
   // List of available localizations.
   availableLangs: { en:1,ru:1 },
   lang: 'ru,en', // %REMOVE_LINE_CORE%
   requires: 'dialog',
   icons: 'specialchar', // %REMOVE_LINE_CORE%
   init: function( editor ) {
      var pluginName = 'specialchar',
         plugin = this;

      // Register the dialog.
      VED.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' );

      editor.addCommand( pluginName, {
         exec: function() {
            var langCode = editor.langCode;
            langCode =
               plugin.availableLangs[ langCode ] ? langCode :
               plugin.availableLangs[ langCode.replace( /-.*/, '' ) ] ? langCode.replace( /-.*/, '' ) :
               'en';

            // VED.scriptLoader.load( VED.getUrl( plugin.path + 'dialogs/lang/' + langCode + '.js' ), function() {
               VED.tools.extend( editor.lang.specialchar, plugin.langEntries[ langCode ] );
               editor.openDialog( pluginName );
            // });
         },
         modes: { wysiwyg:1 },
         canUndo: false
      });

      // Register the toolbar button.
      editor.ui.addButton && editor.ui.addButton( 'SpecialChar', {
         label: editor.lang.specialchar.toolbar,
         command: pluginName,
         toolbar: 'insert,50'
      });
   }
});

/**
 * The list of special characters visible in the "Special Character" dialog window.
 *
 *    config.specialChars = [ '&quot;', '&rsquo;', [ '&custom;', 'Custom label' ] ];
 *    config.specialChars = config.specialChars.concat( [ '&quot;', [ '&rsquo;', 'Custom label' ] ] );
 *
 * @cfg
 * @member VED.config
 */
VED.config.specialChars = [
   '!', '&quot;', '#', '$', '%', '&amp;', "'", '(', ')', '*', '+', '-', '.', '/',
   '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';',
   '&lt;', '=', '&gt;', '?', '@',
   'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',
   'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
   '[', ']', '^', '_', '`',
   'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
   'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
   '{', '|', '}', '~',
   "&euro;", "&lsquo;", "&rsquo;", "&ldquo;", "&rdquo;", "&ndash;", "&mdash;", "&iexcl;", "&cent;", "&pound;", "&curren;", "&yen;", "&brvbar;", "&sect;", "&uml;", "&copy;", "&ordf;", "&laquo;", "&not;", "&reg;", "&macr;", "&deg;", "&sup2;", "&sup3;", "&acute;", "&micro;", "&para;", "&middot;", "&cedil;", "&sup1;", "&ordm;", "&raquo;", "&frac14;", "&frac12;", "&frac34;", "&iquest;", "&Agrave;", "&Aacute;", "&Acirc;", "&Atilde;", "&Auml;", "&Aring;", "&AElig;", "&Ccedil;", "&Egrave;", "&Eacute;", "&Ecirc;", "&Euml;", "&Igrave;", "&Iacute;", "&Icirc;", "&Iuml;", "&ETH;", "&Ntilde;", "&Ograve;", "&Oacute;", "&Ocirc;", "&Otilde;", "&Ouml;", "&times;", "&Oslash;", "&Ugrave;", "&Uacute;", "&Ucirc;", "&Uuml;", "&Yacute;", "&THORN;", "&szlig;", "&agrave;", "&aacute;", "&acirc;", "&atilde;", "&auml;", "&aring;", "&aelig;", "&ccedil;", "&egrave;", "&eacute;", "&ecirc;", "&euml;", "&igrave;", "&iacute;", "&icirc;", "&iuml;", "&eth;", "&ntilde;", "&ograve;", "&oacute;", "&ocirc;", "&otilde;", "&ouml;", "&divide;", "&oslash;", "&ugrave;", "&uacute;", "&ucirc;", "&uuml;", "&yacute;", "&thorn;", "&yuml;", "&OElig;", "&oelig;", "&#372;", "&#374", "&#373", "&#375;", "&sbquo;", "&#8219;", "&bdquo;", "&hellip;", "&trade;", "&#9658;", "&bull;", "&rarr;", "&rArr;", "&hArr;", "&diams;", "&asymp;"
];

VED.config.specialChars = [
   '&nbsp;','&amp;','"','¢','€','£','¥','©','®','™','‰','µ','·','•','…','′','″','§','¶','ß',
   '‹','›','«','»','‘','’','“','”','‚','„','&','l','t',';','&','g','t',';','≤','≥','–','—','¯','‾','¤','¦',
   '¨','¡','¿','ˆ','˜','°','−','±','÷','⁄','×','¹','²','³','¼','½','¾','ƒ','∫','∑',
   '∞','√','≈','≠','≡','∏','¬','∩','∂','´','¸','ª','º','†','‡','À','Á','Â','Ã','Ä',
   'Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Œ',
   'Š','Ù','Ú','Û','Ü','Ý','Ÿ','Þ','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë',
   'ì','í','î','ï','ð','ñ','ò','ó','ô','õ','ö','ø','œ','š','ù','ú','û','ü','ý','þ',
   'ÿ','Α','Β','Γ','Δ','Ε','Ζ','Η','Θ','Ι','Κ','Λ','Μ','Ν','Ξ','Ο','Π','Ρ','Σ','Τ',
   'Υ','Φ','Χ','Ψ','Ω','α','β','γ','δ','ε','ζ','η','θ','ι','κ','λ','μ','ν','ξ','ο',
   'π','ρ','ς','σ','τ','υ','φ','χ','ψ','ω','←','↑','→','↓','↔','◊','♣','♥','♦','&nbsp;'
];






